/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.germinus.telcoblocks.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.germinus.telcoblocks.Centralita_VOIP;
import org.germinus.telcoblocks.TelcoblocksPackage;
import org.germinus.telcoblocks.TipoCentralita;
import org.germinus.telcoblocks.YesNo;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Centralita VOIP</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getIP <em>IP</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getUsercallerid <em>Usercallerid</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getBindport <em>Bindport</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getBindaddr <em>Bindaddr</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getDomain <em>Domain</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getVideosupport <em>Videosupport</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getExternrefresh <em>Externrefresh</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.Centralita_VOIPImpl#getTipo <em>Tipo</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class Centralita_VOIPImpl extends EObjectImpl implements Centralita_VOIP {
	/**
	 * The default value of the '{@link #getIP() <em>IP</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getIP()
	 * @generated
	 * @ordered
	 */
	protected static final String IP_EDEFAULT = "0.0.0.0";

	/**
	 * The cached value of the '{@link #getIP() <em>IP</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getIP()
	 * @generated
	 * @ordered
	 */
	protected String ip = IP_EDEFAULT;

	/**
	 * The default value of the '{@link #getUsercallerid() <em>Usercallerid</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUsercallerid()
	 * @generated
	 * @ordered
	 */
	protected static final YesNo USERCALLERID_EDEFAULT = YesNo.YES;

	/**
	 * The cached value of the '{@link #getUsercallerid() <em>Usercallerid</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUsercallerid()
	 * @generated
	 * @ordered
	 */
	protected YesNo usercallerid = USERCALLERID_EDEFAULT;

	/**
	 * The default value of the '{@link #getBindport() <em>Bindport</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBindport()
	 * @generated
	 * @ordered
	 */
	protected static final int BINDPORT_EDEFAULT = 5060;

	/**
	 * The cached value of the '{@link #getBindport() <em>Bindport</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBindport()
	 * @generated
	 * @ordered
	 */
	protected int bindport = BINDPORT_EDEFAULT;

	/**
	 * The default value of the '{@link #getBindaddr() <em>Bindaddr</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBindaddr()
	 * @generated
	 * @ordered
	 */
	protected static final String BINDADDR_EDEFAULT = "0.0.0.0";

	/**
	 * The cached value of the '{@link #getBindaddr() <em>Bindaddr</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBindaddr()
	 * @generated
	 * @ordered
	 */
	protected String bindaddr = BINDADDR_EDEFAULT;

	/**
	 * The default value of the '{@link #getDomain() <em>Domain</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDomain()
	 * @generated
	 * @ordered
	 */
	protected static final String DOMAIN_EDEFAULT = "gsi.dit.upm.es";

	/**
	 * The cached value of the '{@link #getDomain() <em>Domain</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDomain()
	 * @generated
	 * @ordered
	 */
	protected String domain = DOMAIN_EDEFAULT;

	/**
	 * The default value of the '{@link #getVideosupport() <em>Videosupport</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVideosupport()
	 * @generated
	 * @ordered
	 */
	protected static final YesNo VIDEOSUPPORT_EDEFAULT = YesNo.YES;

	/**
	 * The cached value of the '{@link #getVideosupport() <em>Videosupport</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVideosupport()
	 * @generated
	 * @ordered
	 */
	protected YesNo videosupport = VIDEOSUPPORT_EDEFAULT;

	/**
	 * The default value of the '{@link #getExternrefresh() <em>Externrefresh</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExternrefresh()
	 * @generated
	 * @ordered
	 */
	protected static final int EXTERNREFRESH_EDEFAULT = 10;

	/**
	 * The cached value of the '{@link #getExternrefresh() <em>Externrefresh</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExternrefresh()
	 * @generated
	 * @ordered
	 */
	protected int externrefresh = EXTERNREFRESH_EDEFAULT;

	/**
	 * The default value of the '{@link #getTipo() <em>Tipo</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTipo()
	 * @generated
	 * @ordered
	 */
	protected static final TipoCentralita TIPO_EDEFAULT = TipoCentralita.ASTERISK;

	/**
	 * The cached value of the '{@link #getTipo() <em>Tipo</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTipo()
	 * @generated
	 * @ordered
	 */
	protected TipoCentralita tipo = TIPO_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected Centralita_VOIPImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return TelcoblocksPackage.Literals.CENTRALITA_VOIP;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getIP() {
		return ip;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setIP(String newIP) {
		String oldIP = ip;
		ip = newIP;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__IP, oldIP, ip));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public YesNo getUsercallerid() {
		return usercallerid;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setUsercallerid(YesNo newUsercallerid) {
		YesNo oldUsercallerid = usercallerid;
		usercallerid = newUsercallerid == null ? USERCALLERID_EDEFAULT : newUsercallerid;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__USERCALLERID, oldUsercallerid, usercallerid));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getBindport() {
		return bindport;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBindport(int newBindport) {
		int oldBindport = bindport;
		bindport = newBindport;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__BINDPORT, oldBindport, bindport));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getBindaddr() {
		return bindaddr;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBindaddr(String newBindaddr) {
		String oldBindaddr = bindaddr;
		bindaddr = newBindaddr;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__BINDADDR, oldBindaddr, bindaddr));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getDomain() {
		return domain;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDomain(String newDomain) {
		String oldDomain = domain;
		domain = newDomain;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__DOMAIN, oldDomain, domain));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public YesNo getVideosupport() {
		return videosupport;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVideosupport(YesNo newVideosupport) {
		YesNo oldVideosupport = videosupport;
		videosupport = newVideosupport == null ? VIDEOSUPPORT_EDEFAULT : newVideosupport;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__VIDEOSUPPORT, oldVideosupport, videosupport));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getExternrefresh() {
		return externrefresh;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setExternrefresh(int newExternrefresh) {
		int oldExternrefresh = externrefresh;
		externrefresh = newExternrefresh;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__EXTERNREFRESH, oldExternrefresh, externrefresh));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TipoCentralita getTipo() {
		return tipo;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTipo(TipoCentralita newTipo) {
		TipoCentralita oldTipo = tipo;
		tipo = newTipo == null ? TIPO_EDEFAULT : newTipo;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TelcoblocksPackage.CENTRALITA_VOIP__TIPO, oldTipo, tipo));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case TelcoblocksPackage.CENTRALITA_VOIP__IP:
				return getIP();
			case TelcoblocksPackage.CENTRALITA_VOIP__USERCALLERID:
				return getUsercallerid();
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDPORT:
				return new Integer(getBindport());
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDADDR:
				return getBindaddr();
			case TelcoblocksPackage.CENTRALITA_VOIP__DOMAIN:
				return getDomain();
			case TelcoblocksPackage.CENTRALITA_VOIP__VIDEOSUPPORT:
				return getVideosupport();
			case TelcoblocksPackage.CENTRALITA_VOIP__EXTERNREFRESH:
				return new Integer(getExternrefresh());
			case TelcoblocksPackage.CENTRALITA_VOIP__TIPO:
				return getTipo();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case TelcoblocksPackage.CENTRALITA_VOIP__IP:
				setIP((String)newValue);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__USERCALLERID:
				setUsercallerid((YesNo)newValue);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDPORT:
				setBindport(((Integer)newValue).intValue());
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDADDR:
				setBindaddr((String)newValue);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__DOMAIN:
				setDomain((String)newValue);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__VIDEOSUPPORT:
				setVideosupport((YesNo)newValue);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__EXTERNREFRESH:
				setExternrefresh(((Integer)newValue).intValue());
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__TIPO:
				setTipo((TipoCentralita)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case TelcoblocksPackage.CENTRALITA_VOIP__IP:
				setIP(IP_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__USERCALLERID:
				setUsercallerid(USERCALLERID_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDPORT:
				setBindport(BINDPORT_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDADDR:
				setBindaddr(BINDADDR_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__DOMAIN:
				setDomain(DOMAIN_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__VIDEOSUPPORT:
				setVideosupport(VIDEOSUPPORT_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__EXTERNREFRESH:
				setExternrefresh(EXTERNREFRESH_EDEFAULT);
				return;
			case TelcoblocksPackage.CENTRALITA_VOIP__TIPO:
				setTipo(TIPO_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case TelcoblocksPackage.CENTRALITA_VOIP__IP:
				return IP_EDEFAULT == null ? ip != null : !IP_EDEFAULT.equals(ip);
			case TelcoblocksPackage.CENTRALITA_VOIP__USERCALLERID:
				return usercallerid != USERCALLERID_EDEFAULT;
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDPORT:
				return bindport != BINDPORT_EDEFAULT;
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDADDR:
				return BINDADDR_EDEFAULT == null ? bindaddr != null : !BINDADDR_EDEFAULT.equals(bindaddr);
			case TelcoblocksPackage.CENTRALITA_VOIP__DOMAIN:
				return DOMAIN_EDEFAULT == null ? domain != null : !DOMAIN_EDEFAULT.equals(domain);
			case TelcoblocksPackage.CENTRALITA_VOIP__VIDEOSUPPORT:
				return videosupport != VIDEOSUPPORT_EDEFAULT;
			case TelcoblocksPackage.CENTRALITA_VOIP__EXTERNREFRESH:
				return externrefresh != EXTERNREFRESH_EDEFAULT;
			case TelcoblocksPackage.CENTRALITA_VOIP__TIPO:
				return tipo != TIPO_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (IP: ");
		result.append(ip);
		result.append(", usercallerid: ");
		result.append(usercallerid);
		result.append(", bindport: ");
		result.append(bindport);
		result.append(", bindaddr: ");
		result.append(bindaddr);
		result.append(", domain: ");
		result.append(domain);
		result.append(", videosupport: ");
		result.append(videosupport);
		result.append(", externrefresh: ");
		result.append(externrefresh);
		result.append(", tipo: ");
		result.append(tipo);
		result.append(')');
		return result.toString();
	}

} //Centralita_VOIPImpl
